import wcocr
import io
import os
import sys
import json
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
def load(exe_path, runtime_path, img_path):
    wechat_path = exe_path
    wechat_runtime = runtime_path
    wcocr.init(wechat_path, wechat_runtime)
    result = wcocr.ocr(img_path)
    print(json.dumps(result, ensure_ascii=False))

if __name__ == '__main__':
    exe_path = sys.argv[1]
    runtime_path = sys.argv[2]
    img_path = sys.argv[3]
    load(exe_path, runtime_path, img_path)